﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="addpurchaseyyyy.aspx.cs"  Inherits="StoreWeb.system.purchaseManage.addpurchaseyyyy" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="../../lib/html5.js"></script>
<script type="text/javascript" src="../../lib/respond.min.js"></script>
<script type="text/javascript" src="../../lib/PIE_IE678.js"></script>
<![endif]-->
<link href="../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="../../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<link href="../../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<%--<link href="../../css/extension.css" rel="stylesheet" />--%>
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title></title>
</head>
<body>
<form method="post"    runat="server" id="formmemberadd">
<%-- <form runat="server" method="post" class="form form-horizontal" id="formmemberadd">--%>
  <!--<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 基础档案 <span class="c-gray en">&gt;</span> 业务档案信息 <a class="btn btn-success radius r mr-20" style="line-height: 1.6em; margin-top: 3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>-->
  <div class="pd-20">
    <div class="text-l"> 
        <input name="ceshi" type="text" id="ceshi"  hidden runat="server" />
        <asp:Button  ID="btnserach" class="btn btn-success radius" runat="server" Text="包装类" OnClick="btnserach_Click"   OnClientClick="admin_role_add('btnserach','添加经销商','edit.aspx','800','460')" />
        <asp:Button  ID="btnserach2" class="btn btn-success radius" runat="server" Text="功能类" OnClick="btnserach_Click"  OnClientClick="admin_role_add('btnserach2','添加经销商','edit.aspx','800','460')"/>
        <asp:Button  ID="btnserach3" class="btn btn-success radius" runat="server" Text="配饰类" OnClick="btnserach_Click"  OnClientClick="admin_role_add('btnserach3','添加经销商','edit.aspx','800','460')"/>
    </div>
   
    <table id="myTable" class="table table-border table-bordered table-hover table-bg table-sort" style="margin-top:20px;">
      <thead>
        <tr class="text-c">
          <th>产品名称</th>
          <th>介绍</th>
          <th>价格</th>
          <th>数量</th>
          <th>小计</th>
        </tr>
      </thead>
      <tbody>
        <tr class="text-c">
          <td><span>手提袋</span><input type="hidden" name="cpname" value="手提袋"></td>
          <td>XX</td>
          <td>5元</td>
          <td><label><input  class="checkbox" id="1001" value="1001" data-text="张三15123334198" name="purname"  >5</label></td>
           <td>20元</td>
        </tr>
          <tr class="text-c">
          <td><span>手提袋2</span><input type="hidden" name="cpname" value="手提袋2"></td>
          <td>XX</td>
          <td>5元</td>
          <td><label><input  class="checkbox" id="1002" value="1002" data-text="张三15123334198" name="purname"  >6</label></td>
           <td>20元</td>
        </tr>
          <tr class="text-c">
          <td><span>手提袋3</span><input type="hidden" name="cpname" value="手提袋3"></td>
          <td>XX</td>
          <td>5元</td>
          <td><label><input   class="checkbox" id="1003" value="1003" data-text="张三15123334198" name="purname"  ></label></td>
           <td>20元</td>
        </tr>


           <tr  class="text-c">
        	<td>包装类</td>
            <td>介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍介绍</td>
            <td>￥<span class="unit-price"  >15.00</span></td>
            <td class="tc">
            	<span class="button minus">&nbsp;</span>
                <input class="number" type="text" data-price="15" value="1" name="number">
                <span class="button plus">&nbsp;</span>
            </td>
            <td>￥<span class="sum-price" name="sumprice">35.00</span></td>
        </tr>

           <%--<asp:Repeater ID="Repeater1" runat="server">
             <ItemTemplate>
                <tr class="text-c">
                  <td><%#Eval("id") %></td>
                  <td><%#Eval("mobile") %></td>
                  <td><%#Eval("customername") %></td>
                   <td><label><input type="checkbox" class="checkbox" id="<%#Eval("id") %>" value="<%#Eval("id") %>" data-text="<%#Eval("customername") %><%#Eval("mobile") %>" name="">&nbsp;选择</label></td>
                </tr>
             </ItemTemplate>
          </asp:Repeater>--%>
      </tbody>
    </table>
    <div style="text-align:center;">
      <%--<input type="hidden" name="hidwhere" id="hidwhere" />--%>
        <asp:HiddenField ID="hidwhere" runat="server" />
      <!-- AspNetPager 7.5 Copyright:2003-2015 Webdiyer (www.webdiyer.com) -->
      <!--记录总数只有一页，AspNetPager已自动隐藏，若需在只有一页数据时显示AspNetPager，请将AlwaysShow属性值设为true！-->
      <!-- AspNetPager 7.5 Copyright:2003-2015 Webdiyer (www.webdiyer.com) -->
        <input type="hidden" name="hidid" id="hidid" />
        <asp:Button ID="btnok" runat="server"   Text="提交" />
    </div>
  </div>
</form>

    <script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../../lib/Validform/5.3.2/Validform.min.js"></script>
    <script type="text/javascript" src="../../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../js/H-ui.js"></script>
    <script type="text/javascript" src="../../js/H-ui.admin.js"></script>

<script>

    //alert($("#ceshi").val());
    if ($("#ceshi").val() == "btnserach") {
        //document.getElementById("btnserach").style.color = "red";
        document.getElementById("btnserach").style.background = "red";
    }
    if ($("#ceshi").val() == "btnserach2") {
        document.getElementById("btnserach2").style.background = "red";
    }
    if ($("#ceshi").val() == "btnserach3") {
        document.getElementById("btnserach3").style.background = "red";
    }
    function admin_role_add(btnserach, title, url, w, h) {
        $("#ceshi").val(btnserach);
    }


    //$(function () {
    //    $("#formmemberadd").Validform({
    //        tiptype: 2,
    //        btnSubmit: "#btnok",
    //        beforeSubmit: function (curform) {
    //           // alert(document.getElementsByName("purname").length);
    //            //alert($("input[name='purname']").val());
    //            var purnames = "";
    //            $("input[name='purname']").each(
    //            function () {
    //                //alert($(this).val());
    //                purnames += $(this).val()+","
    //            }
    //            )
    //            alert(purnames);
    //            $.post("../../ajax/purchaseManage.aspx", { purname: "" + document.getElementsByName("purname") + "", id: $("#hidid").val() },
    //            function (data) {
    //                //alert(data);
    //                if (data == 1) {
    //                    parent.layer.msg("提交成功", { icon: 1, time: 1000 });
    //                    //window.location.href = "list.aspx";
    //                } else if (data == 2) {
    //                    parent.layer.alert("修改成功", function () {
    //                        parent.location.reload();
    //                    });
    //                } else if (data == 3) {
    //                    parent.location.reload();
    //                } else {
    //                    parent.layer.msg("操作失败");;
    //                }
    //            });
    //            return false;
    //        }
    //    });
    //});



    $("#btnok").click(function () {
        $.ajax({
            url: "../../ajax/purchaseManage.aspx",
            //请求的url地址
            data: $('#formmemberadd').serialize(),
            type: "POST",
            //请求方式
            async: true,//这个地方修改
            success: function (data) {
                alert(data);
                window.location.href = "list.aspx";
            },
            error: function (req) {
                alert(req);
            }
        });
        return false;//这个位置加一个返回失败
    });


</script>
</body>
</html>
